//
//  RootCollectionViewCell.m
//  UI-豆瓣项目APP
//
//  Created by liuxin on 15/11/4.
//  Copyright © 2015年 孙鹏. All rights reserved.
//

#import "RootCollectionViewCell.h"
#import "UIImageView+WebCache.h"
@implementation RootCollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if(self){
        [self createSubView];
    }
    return self;
}
-(void)createSubView{
    self.nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(3, 125, 94, 30)];
    //    self.nameLabel.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:self.nameLabel];
    [_nameLabel release];
    
    self.headImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 100, 130)];
    self.headImageView.backgroundColor = [UIColor purpleColor];
    [self.contentView addSubview:self.headImageView];
    [_headImageView release];
}
-(void)setMov:(MovieList *)mov{
    if (_mov != mov) {
        [_mov release];
        _mov = [mov retain];
    }
    self.nameLabel.text = self.mov.movieName;
    NSURL *url = [NSURL URLWithString:self.mov.pic_url];
    [self.headImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"placehold"]];
}

@end
